package com.lgl.blog.service.impl;

import com.lgl.blog.mapper.BlogMapper;
import com.lgl.blog.pojo.Blog;
import com.lgl.blog.service.IBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: Brook
 * @Date: 2020/10/2 07:59
 * @Description:
 */
@Service
public class BlogServiceImpl implements IBlogService {

    @Autowired private BlogMapper blogMapper;

    @Override
    public Page<Blog> findList(Integer page, Integer size) {
        Pageable pageable = PageRequest.of(page, size);
        Page<Blog> all = blogMapper.findAll(pageable);
        return all;
    }
}
